package com.qk.management.mapper;

import com.qk.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CourseMapper {


    void addCourse(Course course);


    List<Course> page(String name, Integer subject,  Integer target);

    @Select("select * from course where id= #{id}")
    Course selectId(Integer id);

    void updateCourse(Course course);

    @Delete("delete from course where id= #{id}")
    void deleteCourse(Integer id);

    @Select("select * from course")
    List<Course> selectAll();

    @Select("select * from course where subject= #{subject}")
    List<Course> selectSubject(Integer subject);
}
